package com.shixi.shixitraining.shixitraining.ui.tabhome.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.RequestManager;
import com.shixi.shixitraining.shixitraining.R;
import com.shixi.shixitraining.shixitraining.ui.tabhome.entity.HomeGrideAuthenBean;
import com.shixi.shixitraining.shixitraining.util.ImageLoaderUtil;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseAdapter;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseRecycleHolder;

import java.util.List;

/**
 * Created by shenyan on 2018/7/23.
 */

public class HomeTrainingAdapter extends BaseAdapter<HomeGrideAuthenBean> {

    private RequestManager manager;
    public HomeTrainingAdapter(Context context, List<HomeGrideAuthenBean> data, RequestManager manager) {
        super(context, data);
        this.manager=manager;
    }

    @Override
    public void convert(BaseRecycleHolder holder, HomeGrideAuthenBean item, int position) {
        holder.setText(R.id.tv_authen_title,item.getTitle());
        holder.setText(R.id.tv_authen_desc,item.getDesc());
        holder.setText(R.id.tv_authen_price,item.getMoney());
        ImageView imageView = holder.getView(R.id.iv_authen);
        ImageLoaderUtil.displayImage(ImageLoaderUtil.PLAYHOLER_IMAGE_TYPE.MIDDLE_SQUARE,mRequestManager,item.getImageUrl(),imageView);

    }

    @Override
    protected int getLayoutId(int viewType) {
        return R.layout.adapter_home_authen;
    }
}
